// Appendix Table 10: Unconditional Tests of Covariate Balance
	global students	L_BLabil Dmiss_BL Dmale Lage 
	global teachers1 DTeachMale  LTeachAge LTeachExper LTeachEduc 
	global schools Lenrol LPTR LPLEPassRate LNTeachers
	global doutcomes ""
	use "$dir\DataSCLB", clear
	// Subtract average treatment effects
	foreach var in $students $teachers $schools {
		reg `var' MT_Program CCT_Program
		gen _`var' = `var'
		replace _`var' = `var' - _b[MT_Program] if Study_Arm==2
		replace _`var' = `var' - _b[CCT_Program] if Study_Arm==1
		local lab: variable label `var'
		label var _`var' "`lab'"
		global doutcomes $doutcomes _`var'
	}
	// Run rank preservation command without the conditional option. 
	rankbstrp $doutcomes, reps(1000) individuals
	
	
	save "$output/AppendixTable10.dta", replace
	
	use "$output/AppendixTable10.dta", clear
			foreach var in MT_p25 MT_p25_p50 MT_p50_p75 MT_p75 CCT_p25 CCT_p25_p50 CCT_p50_p75 CCT_p75  {
			    replace `var' = subinstr(`var',"[","\text{[",.)
				replace `var' = subinstr(`var',"]","]}",.)
				replace `var' = subinstr(`var',"***","$^{***}$",.)
			}
			
	gen blank2 = ""
	# delimit ;
			texsave names MT_p25 MT_p25_p50 MT_p50_p75 MT_p75 blank2  CCT_p25 CCT_p25_p50 CCT_p50_p75 CCT_p75 using "$output/AT10.tex",
					replace align(lccccccccc) location(H) hlines(8 16) 
					headerlines("& \multicolumn{4}{c}{Full-Cost} & & \multicolumn{4}{c}{Reduced-Cost} \\ 
					\cmidrule{2-5} \cmidrule{7-10}
					& 0-25th Perc. & 25-50th Perc. & 50-75th Perc. & 75-100th Perc. & & 0-25th Perc. & 25-50th Perc. & 50-75th Perc. & 75-100th Perc. \\ 
					\cmidrule{2-5} \cmidrule{7-10}
					& (1) & (2) & (3) & (4) & & (5) & (6) & (7) & (8)")
					marker(tb:rank_preservation) title(\\ Unconditional Tests of Covariate Balance by Endline Test Score Quartile) 
					size(small) frag nofix nonames   ;
			# delimit cr
			
	